package com.lehecai.ucenter.dao.impl.permission;

import java.util.List;

import com.lehecai.ucenter.dao.QueryParam;
import com.lehecai.ucenter.dao.impl.BaseDaoImpl;
import com.lehecai.ucenter.dao.permission.PermissionDao;
import com.lehecai.ucenter.entity.permission.Permission;

public class PermissionDaoImpl extends BaseDaoImpl<Permission,Long> implements PermissionDao{
	@Override
	public List<Permission> getAll() {
		QueryParam queryParam = new QueryParam();
		queryParam.setEntityName(Permission.entityName);
		return super.findList(queryParam);
	}
	
	public List<Permission> findPermissions(Permission permission) {
		QueryParam queryParam = new QueryParam();
		queryParam.setEntityName(Permission.entityName);
		queryParam.setParameter(Permission.PARENT_ID_PROPERTY_NAME, permission.getParentId());
		return super.findList(queryParam);
	}
}
